/*
uwb.h
uwb.c headfile ,api. data type define
designed by lunanting

------------------------
2020-03-31 14:11:55
create file
------------------------

*/
#ifndef __UWB_H
#define __UWB_H

#include "aos/hal/uart.h"
#include "stdint.h"
#include "base_type.h"

/**************************datet type*****************/
//uwb 


//wub data 
typedef struct{
    int x;  //uwb location x value :cm
    int y;  //uwb location y value :cm
    int z;  //uwb location z value :cm
    long long int timestamp;    //uwb location time stamp
}UWB_data;

//uwb state
typedef struct{
    UWB_data data;  //uwb location data
    uart_dev_t uart;    //uart device data
    int8_t init;    //init state,0=uninit,1=init
    u16 id; //lable id
}UWB_state;


/*********************function extern****************/
extern int xp_uwb_init(uint8_t port,int speed,u16 id); //uwb init
extern int xp_uwb_get_location(UWB_data *data); //get uwb location
extern int8_t xp_check_sum(const uint8_t *data,int len);  //check sum

extern void xp_uwb_test(void);  //uwb test
extern int xp_uwb_debug(char *type,char *fun,char *param);

#endif
//end of the file
